# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=burpsuite
pkgver=2025.11.2
pkgrel=1
epoch=1
groups=('blackarch' 'blackarch-webapp' 'blackarch-proxy' 'blackarch-scanner'
        'blackarch-fuzzer')
pkgdesc='An integrated platform for attacking web applications (community edition) + SHELLING plugin.'
arch=('any')
url='https://portswigger.net/burp/releases'
license=('custom')
depends=('java-runtime>=17' 'giflib' 'libxext' 'libxrender' 'libxtst')
makedepends=('git')
noextract=("$pkgname.jar")
source=("$pkgname.jar::https://portswigger.net/burp/releases/download?product=community&version=$pkgver&type=jar"
        'LICENSE'
        "$pkgname.desktop"
        'icon64.png'
        'git+https://github.com/PortSwigger/command-injection-attacker.git')
sha512sums=('e309129dc58183766634c3f8b18247780d883811d4b784c21f78573036db5efa9508984803c68155e0b31c615cad452c1d980b94ab1c575002bb1deb299fa718'
            '07f646ce79e4e259c8da4a16ecd9b0149f09cd047ab42bfb758dc1cd4871710866e4dae6cda572f96fb49d0b156e64dd7b0a78904d9d367d41136214de5488a2'
            '292dcc47a625f69f0a235c8333e74eef437ec77095f731e97e5065261a7067a03f361375a10631828b42484f77b3e5d24ce71ceff174b0d6083f3a7abebe677c'
            '928083e0189ce50304c4b32f8f6ef56be79881090bffdaddb5e990a59186ed2596c03293255693d488a47519e6da4e969e74e9bfe22a0f6ca53491a4e0749575'
            'SKIP')

package() {
  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/"{applications,pixmaps,${pkgname},licenses/${pkgname}}

  install -Dm 644 "$pkgname.jar" "$pkgdir/usr/share/$pkgname/$pkgname.jar"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm 644 "$pkgname.desktop" "$pkgdir/usr/share/applications/"
  install -Dm 644 icon64.png "$pkgdir/usr/share/pixmaps/$pkgname.png"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec \$JAVA_HOME/bin/java -jar /usr/share/$pkgname/$pkgname.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"

  # SHELLING plugin
  cd command-injection-attacker
  install -Dm 644 SHELLING.jar "$pkgdir/usr/share/$pkgname/SHELLING.jar"
}

